{% macro render_pagination(pagination) %}
  <div class="pagination">
    <ul>
      {% if not pagination.has_prev %}
        <li class="disabled">
          <a>&laquo;{{ _("上一页") }}</a>
        </li>
      {% else %}
        <li>
          <a href="{{ url_for_other_page(page=pagination.page - 1 if pagination.page > 1 else 1) }}">&laquo;{{ _("上一页") }}</a>
        </li>
      {% endif %}
      {% for page in pagination.iter_pages() %}
        {% if page %}
          <li class="{% if page == pagination.page %}active{% endif %}">
            <a href="{{ url_for_other_page(page=page) }}">{{ page }}</a>
          </li>
        {% else %}
          <li class="disabled"><a>...</a></li>
        {% endif %}
      {% endfor %}
      {% if pagination.has_next %}
        <li>
          <a href="{{ url_for_other_page(pagination.page + 1) }}">{{ _("下一页") }}&raquo;</a>
        </li>
      {% else %}
        <li class="disabled"><a>{{ _("下一页") }}&raquo;</a></li>
      {% endif %}
      <li class="disabled">
        <a>{{ _("""符合条件的记录共%(count)d条""", count=pagination.total_count) }}</a>
      </li>
    </ul>
  </div>
{% endmacro %}
